package com.example.demo.leetcode.classics150;

/**
 * ******************************************************
 *
 * @author liugh9
 * @version 1.0
 * @classname _116寻找峰值
 * @description
 * @date 2023/08/15 19:53
 * <p>
 * ******************************************************
 */
public class _116寻找峰值 {
    public int findPeakElement(int[] nums) {
        int max = Integer.MIN_VALUE;
        int index = 0;
        for (int i = 0; i < nums.length; i++) {
            if (max < nums[i]) {
                max = nums[i];
                index = i;
            }
        }
        return index;
    }

}
